import request from '@/utils/request'

// 获取所属区域下拉列表
export function getAreaList() {
  return request({
    url: '/operation/web/operationEquipmentManagement/areaList',
    method: 'get'
  })
}

// 获取设备类型下拉列表
export function getEquipmentTypeList() {
  return request({
    url: '/operation/web/operationEquipmentManagement/equipmentTypeList',
    method: 'get'
  })
}

// 获取设备状态下拉列表
export function getEquipmentStatusList() {
  return request({
    url: '/operation/web/operationEquipmentManagement/equipmentStatusList',
    method: 'get'
  })
}

// 查询设备管理列表
export function getEquipmentList(params) {
  return request({
    url: '/operation/web/operationEquipmentManagement/list',
    method: 'get',
    params
  })
}

// 获取设备管理详细信息
export function getEquipmentDetail(id) {
  return request({
    url: `/operation/web/operationEquipmentManagement/${id}`,
    method: 'get'
  })
}

// 新增设备管理
export function addEquipment(data) {
  return request({
    url: '/operation/web/operationEquipmentManagement',
    method: 'post',
    data
  })
}

// 修改设备管理
export function updateEquipment(data) {
  return request({
    url: '/operation/web/operationEquipmentManagement',
    method: 'put',
    data
  })
}

// 删除设备管理
export function deleteEquipment(ids) {
  return request({
    url: `/operation/web/operationEquipmentManagement/${ids}`,
    method: 'delete'
  })
}

// 导出设备管理列表
export function exportEquipment(params) {
  return request({
    url: '/operation/web/operationEquipmentManagement/export',
    method: 'post',
    params,
    responseType: 'blob'
  })
}

